<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <!-- 这是个iphone设备中的safari私有meta标签，它表示：允许全屏模式浏览；-->
    <meta content="yes" name="apple-mobile-web-app-capable">
    <!-- 全屏显示-->
    <meta name="apple-touch-fullscreen" content="yes">
    <!-- 不要让设备识别电话号码和邮箱地址-->
    <meta content="telephone=no,email=no" name="format-detection">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" id="viewport" name="viewport">
    <!-- DNS预解析-->
    <meta http-equiv="x-dns-prefetch-control" content="on">
    <link href="/static/css/common/reset.css" rel="stylesheet">
    <link href="/static/css/common/common.css" rel="stylesheet">
    <link href="/static/css/index.css" rel="stylesheet">
    
    <title>注册 Register</title>
    <style>

    </style>
  </head>
  <body>
    <div class="registr">
		<form action="../userInfo/bind.htm" method="post" id="form">
		<input type="hidden" name="token" value="${token}" />
		        <div style="text-align:center">
				<img class="logo aligncenter" src="/static/img/logo.png">
				</div>
		        <h4>账户信息 Account Information</h4>
		
		        <input type="text" placeholder="账户名称Account Name" name="userAcount" id="userAcount" maxlength="32">
		        <input type="password" placeholder="密码Password"  name="userPassWord" id="userPassWord" maxlength="32">
		        <input type="password" placeholder="确认密码Confirm Password" name="userPassWordConfrim" id="userPassWordConfrim" maxlength="32">
		        <h4>个人信息 Personal Information</h4>
		        <p class="h_box"><label for="a" class="flex_1"><input id="a" type="radio" placeholder="Account Name" value="1" checked  name="userSex" > Mr.先生</label><label for="b" class="flex_1"><input id="b" type="radio" placeholder="Account Name" value="2"  name="userSex"> Ms.女士</label></p>
		           <input type="text" placeholder="名First Name" name="userFirstName" id="userFirstName" value="" maxlength="50" >
		        <input type="text" placeholder="姓Last Name" name="userLastName" id="userLastName" value="" maxlength="50">
		        <input type="text" placeholder="公司 Company" name="userEmployer" id="userEmployer" value="" maxlength="150">
		        <input type="text" placeholder="职位Job Title"  name="userJob" id="userJob" value="" maxlength="50">
		         <input type="text" placeholder="行业 Industry"  name="userIndustry" id="userIndustry" maxlength=50"">
		        <input type="text" placeholder="邮箱 Email"  name="userEmail" id="userEmail" value=""  maxlength="50" >
		        <input type="text" placeholder="地址 Base Location" name="userLocation" id="userLocation"  maxlength="150"></textarea>
		   
		 </form>
      </div>
  <button class="btn" onclick="submit();" id="submitBtn">提交Submit</button>
 

 
	<!--提示框-->
	<script type="text/javascript" src="/static/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="/static/js/jquery.tips.js"></script>
    <script src="/static/js/remset.js"></script>
    <script src="/static/js/zepto-1.1.4.min.js" type="text/javascript"></script>
   <script   type="text/javascript">
    	function submit(){
    		if($("#userAcount").val()==""){
				$("#userAcount").tips({
					side:3,
		            msg:'please input userAcount',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userAcount").focus();
			return false;
			}
    		if($("#userPassWord").val()==""){
				$("#userPassWord").tips({
					side:3,
		            msg:'please input password',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userPassWord").focus();
			return false;
			}
    		if($("#userPassWordConfrim").val()==""){
				$("#userPassWordConfrim").tips({
					side:3,
		            msg:'please input  PassWordConfrim',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userPassWordConfrim").focus();
			return false;
			}
    		if($("#userPassWordConfrim").val() != $("#userPassWord").val()){
				$("#userPassWordConfrim").tips({
					side:3,
		            msg:'userPassWordConfrim is not equals userPassWord!',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userPassWordConfrim").focus();
			return false;
			}
    		if($("#userFirstName").val()==""){
				$("#userFirstName").tips({
					side:3,
		            msg:'please input First Name',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userFirstName").focus();
			return false;
			}
    		if($("#userLastName").val()==""){
				$("#userLastName").tips({
					side:3,
		            msg:'please input Last Name',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userLastName").focus();
			return false;
			}
    		if($("#userEmployer").val()==""){
				$("#userEmployer").tips({
					side:3,
		            msg:'please input Current Employer',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userEmployer").focus();
			return false;
			}
    		if($("#userJob").val()==""){
				$("#userJob").tips({
					side:3,
		            msg:'please input Job Title',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userJob").focus();
			return false;
			}
			
			if($("#userIndustry").val()==""){
				$("#userIndustry").tips({
					side:3,
		            msg:'please input userIndustry',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userIndustry").focus();
			return false;
			}
			
    		if($("#userEmail").val()==""){
				$("#userEmail").tips({
					side:3,
		            msg:'please input Email',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userEmail").focus();
			return false;
			}
    		if(!isEmail($("#userEmail").val())){
				$("#userEmail").tips({
					side:3,
		            msg:'please input valid Email',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userEmail").focus();
			return false;
			}
			 
    		if($("#userLocation").val()==""){
				$("#userLocation").tips({
					side:3,
		            msg:'please input Base Location',
		            bg:'#AE81FF',
		            time:2
		        });
				$("#userLocation").focus();
			return false;
			}
			 
			 
			 $.ajax({
				 	
					type: "POST",
					headers: {
		                'Accept': 'application/json',
		                'Content-Type': 'application/json'
		            },
					url: '../userInfo/validateInfo.htm?'
							+ new Date().getTime(),
					data : {
						userAcount : $("#userAcount").val().trim()
					},
					dataType : 'json',
					cache : false,
					success : function(data) {
						//console.info(11);
						if (data.result == "ok") {
							  $.ajax({
									type: "POST",
									headers: {
						                'Accept': 'application/json',
						                'Content-Type': 'application/json'
						            },
									url: '../userInfo/validateInfo.htm?'
											+ new Date().getTime(),
									data : {
										userEmail : $("#userEmail").val().trim()
									},
									dataType : 'json',
									cache : false,
									success : function(data) {
										//console.info(11);
										if (data.result == "ok") {
											 	$("#submitBtn").attr({"disabled":"disabled"});
	 											$("#form").submit();
										} else {
				
											$("#userEmail").tips({
												side : 3,
												msg : 'email already exsist！',
												bg : '#AE81FF',
												time : 2
											});
											$("#userEmail").focus();
										}
									}
								});
						} else {

							$("#userAcount").tips({
								side : 3,
								msg : 'account already exsist！',
								bg : '#AE81FF',
								time : 2
							});
							$("#userAcount").focus();
						}
					}
				});
			
    	}
    	
    	function isEmail(str) {
			var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
			return reg.test(str);
		}
		function isMobile(str) {
			//			var reg = /^1[3|4|5|8][0-9]\d{4,8}$/; (^(\d{3,4}-)?\d{7,8})$|(13[0-9]{9})  
			var reg = /^(^(\d{3,4}-)?\d{7,8})$|(1\d{10})$/;
			return reg.test(str);
		}
		
		
		
    </script>
     

  </body>
</html>


